{% extends "template-base.html" %}

{% block right_sidebar %}
  <div class="card">
    <div class="card-header">
      <h4>API Methods</h4>
    </div>

    <ul class="dev_nav_sidebar card-body" id='command_list'>
    </ul>
  </div>
{% endblock %}

{% block main %}
  <section class="container-fluid pt-3 p-md-3">
    <div id='command_wrapper'>
        <div id='command_table'>
            <div id='io_wrapper'>
                <div id='input' class='io'>
                    <h2>REST Request</h2>
                    <div id='test_warning' class='alert alert-danger' style='display:none;'>
                        <h4>Test accounts only!</h4>
                        <p>Never submit account secrets to a server you do not control, unless you are prepared to lose ownership of the account!</p>
                    </div>
                    <div style="clear:both;"></div>
                    <h3 id='selected_command' title='Reference information'></h3>
                    <p id='description'></p>
                    <div id='invalid'>Invalid JSON</div>
                    <div id='rest_url_wrapper'>
                        <p><span id='rest_host'>{{ currentpage.rest_host }}</span><span id='rest_url'></span></p>
                    </div>
                    <div id='request_body'></div>
                    <div id='request_options'>
                        <a class="btn btn-outline-secondary api" id='request_button'>Send request</a>
                    </div>
                </div>
                <div id='output' class='io'>
                    <h2>Response</h2>
                    <div>
                        <img class="loader" src="assets/img/xrp-loader-96.png" style="vertical-align: middle; display:none;"/>
                        <span id='rest_responsecode'></span>
                    </div>
                    <div id='response_body'></div>
                    <div id='tooltip'></div>
                </div>
            </div>
        </div>
    </div>
  </section>
{% endblock %}
{% block endbody %}
    <script type='text/javascript'>
    // Set some constants for the REST tool script
    var URL_BASE = '{{ currentpage.rest_host }}';
    var DOC_BASE = '{{ currentpage.doc_page }}';
    </script>
    <link rel='stylesheet' type='text/css' href='assets/css/api-tools.css'/>
    <link rel='stylesheet' type='text/css' href='assets/vendor/codemirror.css'/>
    <script type='text/javascript' src='assets/js/es5-shim.js'></script>
    <script type='text/javascript' src='assets/vendor/codemirror-js-json-lint.min.js'></script>
    <script type='text/javascript' src='assets/vendor/cm-javascript.min.js'></script>
    <script type='text/javascript' src='assets/js/jquery.autosize.input.min.js'></script>
    <script type='text/javascript' src='assets/js/apitool-rest.js'></script>
    <script type='text/javascript' src='assets/{{ currentpage.methods_js }}'></script>

    <script type="application/javascript">
      gtag('config', 'UA-157720658-3', {'content_group1': 'API Tools'});
    </script>
{% endblock %}
